package com.ice.work.project.smart.doc.config;

import com.ice.work.project.smart.doc.builder.BuildDoc;
import com.ice.work.project.smart.doc.property.ServerProperties;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.context.properties.EnableConfigurationProperties;
import org.springframework.context.annotation.Configuration;

/**
 * @Description api doc 配置
 * @Author DELL
 * @Create 2019-12-30
 * @Since 1.0.0
 */
@Configuration
@EnableConfigurationProperties(ServerProperties.class)
@Slf4j
public class SmartDocConfig {
    private ServerProperties serverProperties;
    private BuildDoc buildDoc;

    @Autowired
    public SmartDocConfig(ServerProperties serverProperties, BuildDoc buildDoc) {
        this.serverProperties = serverProperties;
        log.info("加载的数据：{}", this.serverProperties.getOutDirectory());
        this.buildDoc = buildDoc;
        this.buildDoc.execute();
    }

}
